export const validateSelection = (selected) => {
  const validCategories = [
    '图形图像', '编程开发', '游戏娱乐',
    '资讯阅读', '效率办公', '金融理财', '网络应用'
  ];
  
  return {
    isValid: validCategories.includes(selected),
    errorMsg: '选择分类必须与图像展示的7个选项一致'
  };
};

/* 实时验证函数 */
export const realtimeValidate = (inputElement) => {
  inputElement.addEventListener('input', (e) => {
    const validation = validateSelection(e.target.value);
    inputElement.style.borderColor = validation.isValid ? '#1890ff' : '#ff4d4f';
  });
};